<table>
  <tr>
    <th>COD</th>
    <th>QNT</th>
    <th>DESCRIÇÃO</th>
    <th>VALOR</th>
  </tr>
  <?php
	$i = 0;
	foreach ($pecas as $peca):
		$class = null;
		if ($i++ % 2 == 0) {
			$class = ' class="altrow"';
		}
	?>
	<tr<?php echo $class;?>>
		<td><?php echo $peca['OrdemservicosPeca']['peca_id']; ?>&nbsp;</td>
		<td><?php echo $peca['OrdemservicosPeca']['quantidade']; ?>&nbsp;</td>
		<td><?php echo $peca['Peca']['descricao']; ?>&nbsp;</td>
		<td><?php echo 'R$ ' . number_format($peca['Peca']['valor'], 2, ',','.'); ?>&nbsp;</td>
	</tr>
<?php endforeach; ?>
</table>